<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr=[10,20,30,40];
        for(let i=0;i<arr.length;i++){
            console.log(arr[i]);
        }

        console.log(...arr);  

      
       //求数组中最大值
        console.log((Math.max.apply(null,arr))) //40

        console.log(Math.max(...arr));//40


        var arr1=[10,20,30,40];
        var arr2=[20,40,60,80];

        console.log(arr1.concat(arr2));
        console.log(...arr1,...arr2);
    </script>
</body>
</html>